package ar.edu.unlu.sistemas.ws.business;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlType;

@XmlType
public class PeerWS implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -4672509687069204203L;
	private String id;
	private String address;
	private Integer port;
	private String name;
	private Integer status;
	
	
	public PeerWS() {
		super();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PeerWS other = (PeerWS) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getAddress() {
		return address;
	}
	public Integer getPort() {
		return port;
	}
	public void setPort(Integer port) {
		this.port = port;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("Peer("+id+")[");
		sb.append("addr:"+address+",");
		sb.append("port:"+port+",");
		sb.append("name:"+name+"]");
		return sb.toString();
	}
	
}
